This application is based upon and claims the benefit of priority from the prior Japanese Patent Application No. 2000-109542, filed Apr. 11, 2000, the entire contents of which are incorporated herein by reference.
The present invention relates to a data storage device for storing data and a method for controlling the device. More specifically, the present invention relates to a data storage device that has improved the reliability of data stored on a recording medium and a method for controlling the data storage device.
As computer technology advances, various types of electronic equipment, such as multimedia-capable personal computers, set-top boxes, audio/video players, and game machines, have recently been developed. In such electronic equipment, various digital contents, such as image data and music data, which are downloaded through the Internet or the like, can be stored on a recording medium and read and reproduced therefrom.
By adopting a digital compression encoding technique such as MPEG2 and MP3, the digital contents can be downloaded or copied from one recording medium to another without loss of quality. There is a crying need for protecting the digital contents from unauthorized use from the viewpoint of protection by copyright.
Authentication and encryption techniques have recently been developed in order to allow the transfer of contents only between devices having a legal copyright protecting function.
As a typical authentication and encryption technique, the following mechanism has been devised. Authentication and key exchange are performed between the recording medium and the electronic equipment accessing it, using identification information proper to the recording medium. Using an encryption key generated by the authentication and key exchange, data stored on the recording medium is encrypted and decrypted. As another technique, the following mechanism is used: A password is recorded on a recording medium, and the read/write of data from/to the medium is allowed or inhibited according to agreement of the password with the user""s keyed password.
The above techniques are used for maintaining the security of recorded data, and it is expected that the value of such techniques will steadily increase.
However, when system data necessary for data security, such as the above identification information and password, is recorded on a recording medium, and a bit error occurs in the system data, an authentication error occurs in spite of the use of authorized electronic equipment or an authorized user. The user cannot use the contents stored on the recording medium.
The object of the present invention is to provide a data storage device capable of recording data with considerably high reliability by greatly reducing an error from occurring in important recording data such as system data necessary for security, and a method of controlling the device.
In order to attain the above object, a data storage device for storing data according to the present invention comprises a nonvolatile semiconductor memory, including a plurality of pages each having a data area and a redundant area, for allowing a data read/write operation to be performed in units of page; means for generating a first error correcting code and a second error correcting code from first data and second data, respectively, the first data being to be written and the second data being a copy of the first data; and a write control unit configured to write the first data and the second data to the data area in one page of the nonvolatile semiconductor memory and write the first and second error correcting codes, which are generated by the error correcting code generating means, to the redundant area of the one page to which the first data and the second data are written.
In the data storage device so constituted, even when an uncorrectable bit error occurs in one of the first data and its copied second data, correct data can be obtained using the other data and its corresponding error correcting code. Since the first and second data are stored in the same page, they can be read out by only one operation and thus the operation performance can be prevented from deteriorating. Since, moreover, the first and second error correcting codes are stored in the same page as that of the first and second data, they can be read out by one operation together with the first and second data.
In particular, the data size of system data necessary for security of storage data is smaller than that of normal user data or the like, and thus the system data and its copied data can easily be stored in the same page. Consequently, the mechanism of the present invention produces a remarkably good effect especially on the protection of system data, with the result that a defect due to a bit error in the system data can be prevented from occurring and a system having a function of securing storage data can be increased in reliability.
In a data storage device for performing a read/write operation in units of sector, such as a semiconductor disk drive and a magnetic disk drive, system data and its copied data and their corresponding tow ECCs can be recorded in the same sector.
Additional objects and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objects and advantages of the invention may be realized and obtained by means of the instrumentalities and combinations particularly pointed out hereinafter.